<?php

/**
 * 获取城市 省 地区的名称
 */
namespace App\Http\Controllers\Dsc\Model;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Region extends Model
{
    protected $table = 'region';

    /**
     * 获取省 城市 、区的名称 通用
     * auther sk
     * date  20201223 17:22
     * @param $city
     * @return mixed
     */
    public static function returnCity($city)
    {
        $data = DB::connection('mysql2')->table('region')->where(['region_id' => $city])->first(['region_name']);
        $data=objectToArray($data);
        $data = $data['region_name'];
        return $data;
    }


}